import request from "@/utils/request";
import type { Detail } from "@/types/detail";
import type { ResponseType } from "@/types/response";

enum Enum {
    goodDetail = "/goods",
    addCart = "/member/cart"
}

/*获取商品详情的接口*/
export const fetchGoodDetailAPI = (id: string): Promise<ResponseType<Detail>> => request.get<Detail, ResponseType<Detail>>(Enum.goodDetail, { params: { id } });

/*加入购物车的接口*/
export const addCartAPI = (data: { skuId: string, count: number }) => request.post(Enum.addCart, data);
